//参数配置-当前模块 module.html
app.controller('moduleCtrl', function ($scope, $http, $location) {
  //页面通用初始化
  pageInit('module');
  //左侧导航用
  menuInit($scope, $http);
  $scope.menuIndex = 1.1;
  init();
  //获取/刷新模块列表
  function init() {
    $http.get('/deploy/module/init').then(function (response) {
      if (response.status == 200) {
        var message = response.data;
        if (message.code == 0) {
          $scope.modules = message.data;
        } else {
          $.showNotice(message.msg, "danger");
        }
      }
    }).catch(function (response) {
      $.showNotice(response.status + " error：" + response.data.message, "danger");
    });
  }

  //下一步
  $scope.submitFnc = function () {
    if ($scope.loadingNext) return;
    $scope.loadingNext = true;
    $http.get('/deploy/module/submit').then(function (response) {
      $scope.loadingNext = false;
      if (response.status == 200) {
        var message = response.data;
        if (message.code == 0) {
          $location.path('installmodel');
        } else {
          $.showNotice(message.msg, "danger");
        }
      }
    }).catch(function (response) {
      $scope.loadingNext = false;
      $.showNotice(response.status + " error：" + response.data.message, "danger");
    });
  };
});